home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 662 / text0000.txt < prev   
Encoding:
Text File  |  1996-08-06  |  1.0 KB  |  31 lines

  1. >>>>> Tim Boemker <tjb839@zacatecas.optimum.com> writes:
  2.  
  3. > Many times in working with STL I've wished for a new operator to return
  4. > the type of an expression, much the same way sizeof returns the size of
  5. > an expression.
  6.  
  7. > It would allow programs like the following, for example:
  8.  
  9. >    set<foo, less<foo> > s;
  10. >    for(typeof(s)::iterator i = s.begin(); i != s.end(); i++)
  11. >       // do something
  12.  
  13. > I suppose this must have been considered by now.  Has anything come of
  14. > it?
  15.  
  16. It has come up in the committee, but no-one has made a formal proposal, and
  17. it's too late now.
  18.  
  19. g++ has had typeof for a very long time; I believe some other compilers
  20. (Metaware?) have similar functionality with a different name.
  21.  
  22. Jason
  23.  
  24.  
  25. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your
  26.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  27.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  28.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  29.   Comments? mailto:std-c++-request@ncar.ucar.edu
  30. ]
  31.